/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package zsystem;

import java.awt.Dimension;
import java.awt.Image;
import java.net.URL;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.pushingpixels.flamingo.api.common.icon.EmptyResizableIcon;
import org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon;
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon;

/**
 *
 * @author Rabid
 */
public class Resource {

     public static ResizableIcon getResizableIcon(String path) {
        URL imUrl = getResource(path);
        ResizableIcon icon;
        if (imUrl == null) {
            icon = new EmptyResizableIcon(iconInitDemention);
        } else {
            icon = ImageWrapperResizableIcon.getIcon(imUrl, iconInitDemention);
        }
        return icon;
    }
     
     public static ResizableIcon getResizableLogo(String path, Dimension d) {
        URL imUrl = getResource(path);
        ResizableIcon icon;
        if (imUrl == null) {
            icon = new EmptyResizableIcon(d);
        } else {
            icon = ImageWrapperResizableIcon.getIcon(imUrl, d);
        }
        return icon;
    }
    
     public static Icon getTabIcon(URL imageUrl) {
        ImageIcon tabIcon = new ImageIcon(imageUrl);
        tabIcon = new ImageIcon(tabIcon.getImage().getScaledInstance(22, 22, Image.SCALE_SMOOTH));
        return tabIcon;
    }
    
    public static URL getResource(String path) {
        return Resource.class.getResource(path);
    }
        public static Dimension iconInitDemention = new Dimension(22, 22);
     
//    Master    
    public static final String MEMBERS = "/zresources/icons/master/members.png";
    public static final String MEMBER_TYPE = "/zresources/icons/master/member_type.png";
    public static final String COMMITTEE = "/zresources/icons/master/committee.png";
    public static final String ACCOUNT = "/zresources/icons/master/account.png";
    public static final String LOGO = "/zresources/icons/system/logoXL.png";
}